<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>Document</title>
		<link rel="stylesheet" href="../css/base.css">
		<link rel="stylesheet" href="../css/General.css">
		<script src="../lib/rem.js" charset="utf-8"></script>
		<script src="../lib/zepto.min.js" charset="utf-8"></script>
		<script src="../js/category.js" charset="utf-8"></script>
	</head>

	<body>
		<a href="top"></a>
		<div class="layout">
			<!-- 顶部 -->
			<div class="head clearfix">
				<header class="clearfix">
					<div class="f_left">
						<a href="javascript:;"><img src="../images/header_logo.png" alt=""></a>
					</div>
					<div class="f_right">
						<a href="#"><img src="../images/header_app.png" alt=""></a>
					</div>
				</header>
				<div class="buy_search">
					<form class="buy_searchBox" action="index.html" method="post">
						<input type="text" placeholder="请输入你想比价的商品">
					</form>
					<input class="searching" type="button" name="" value="搜索">
				</div>
			</div>

			<!-- 商品分类 -->

			<div class="productFrom" id="list">
				<!--<div class="productTitle_item_js">
					<div class="productTitle">
						<h1 class="title_js">大 家 电</h1>
						<a href="javascript:;">></a>

						<p class="item_id_js" hidden></p>
						<p class="item_tid_js" hidden></p>
					</div>
					<div class="productlist_nav">
						<ul class="product_cont">
							<li class="product_list">
								<a href="javascript:;" class="category">电视</a>
								<p class="categoryId" hidden></p>
								<p class="titleId" hidden></p>
								<p class="_id" hidden></p>
								<p class="__v" hidden></p>
							</li>
						</ul>
					</div>
				</div>-->
			<div class="productTitle_item">
				<div class="productTitle">
					<h2 class="title_js">大 家 电</h2>
					<a href="javascript:;">></a>
					<p class="id_js" hidden></p>
				    <p class="titleId_js" hidden></p>
				</div>
				<div class="productlist_nav">
					<ul class="product_count">
						<li class="product_list"><a class="category">电视</a>
						<p class="categoryId" hidden></p>
								<p class="titleId" hidden></p>
								<p class="_id" hidden></p>
								<p class="__v" hidden></p></li>
						<!--<li><a href="javascript:;">空调</a></li>
						<li><a href="javascript:;">影院</a></li>
						<li><a href="javascript:;">冰箱</a></li>
						<li><a href="javascript:;">DVD</a></li>
						<li><a href="javascript:;">音响/冰箱</a></li>
						<li><a href="javascript:;">洗衣机</a></li>
						<li><a href="javascript:;">热水机</a></li>
						<li><a href="javascript:;">酒柜/冰吧/冷柜</a></li>
						<li><a href="javascript:;">消毒柜/洗碗机</a></li>-->
					</ul>
				</div>
			</div>
			</div>
			<!-- 底部 -->
			<footer>
				<header>
					<h2>品牌排行</h2>
					<div>></div>
				</header>
				<nav>
					<div class="perch"></div>
					<ul>
						<li>
							<a href="javascript:;">登录</a>
						</li>
						<li>
							<a href="javascript:;">注册</a>
						</li>
						<li>
							<a href="#top"><img src="../images/toTop.png" alt="">返回顶部</a>
						</li>
					</ul>
				</nav>
				<div class="end">
					<span>手机app下载</span>
					<span>慢慢买手机版-掌上比价平台</span><br>
					<span>m.manmanbuy.com</span>
				</div>
			</footer>

		</div>
	</body>
	<!--<script>
		var item = $(".productTitle_item_js").clone(true);
		var itemlist = $(".product_list").clone(true);

		item.find(".product_list").remove();
		$(".productTitle_item_js").remove();

		$.ajax({
			url: 'http://127.0.0.1:3000/api/getcategorytitle',
			dataType: 'JSONP',
			success: function(data) {
				// console.log(data);
				data = JSON.parse(data);
				data = data.result;

				for(var i = 0; i < data.length; i++) {
					var ic = item.clone(true);
					var idata = data[i];

					ic.find(".title_js").text(idata.title);
					ic.find(".item_id_js").text(idata._id);
					ic.find(".item_tid_js").text(idata.titleId);

					$("#list").append(ic);
				}
			}
		});

		$(".productFrom").on("click", ".productTitle_item_js", function() {
			var cont = $(this).find(".product_cont");

			if($(this).find(".product_cont").children().length == 0) {
				var its = $(this).find(".item_tid_js").text();
				$.ajax({
					url: 'http://127.0.0.1:3000/api/getcategory?titleid=' + its,
					dataType: 'JSONP',
					success: function(data) {
						// console.log(data);
						data = JSON.parse(data);
						data = data.result;
						for(var i = 0; i < data.length; i++) {
							var ic = itemlist.clone(true);
							var idata = data[i];

							ic.find(".categoryId").text(idata.categoryId);
							ic.find(".category").text(idata.category);
							ic.find(".titleId").text(idata.titleId);
							ic.find("._id").text(idata._id);
							ic.find(".__v").text(idata.__v);

							cont.append(ic);
						}
					}
				});
				return;
			}
			cont.toggle();
			// if(cont.attr("hidden") == "hidden") {
			// 	cont.removeAttr("hidden");
			// } else {
			// 	cont.attr("hidden", "hidden");
			// }

		});
	</script>-->

</html>